package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDate;
import java.util.List;

/**
 * 采购信息
 * （采购编号，采购日期（当前时间），供应商名称，采购员真实姓名，采购详情集合）
 */
@Data
@ApiModel(value = "采购信息")
@TableName("t_buyorder")
public class BuyOrderBean {
    @ApiModelProperty(hidden = true)
    @TableId(value = "pk_buyOrderId",type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "采购日期")
    @TableField("o_date")
    private LocalDate date=LocalDate.now();//采购日期
    @ApiModelProperty(value = "供应商名字")
    @TableField("o_supplierName")
    private String supplierName;//供应商名字
    @ApiModelProperty(value = "采购员真实姓名")
    @TableField("o_buyUserName")
    private String buyUserName;//采购员真实姓名
    @ApiModelProperty(value = "采购详情集合")
    @TableField(exist = false)
    private List<BuyDetailBean> buyDetailList;//采购详情集合
    public BuyOrderBean() {
    }

    public BuyOrderBean(String supplierName, String buyUserName) {
        this.supplierName = supplierName;
        this.buyUserName = buyUserName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getBuyUserName() {
        return buyUserName;
    }

    public void setBuyUserName(String buyUserName) {
        this.buyUserName = buyUserName;
    }

    public List<BuyDetailBean> getBuyDetailList() {
        return buyDetailList;
    }

    public void setBuyDetailList(List<BuyDetailBean> buyDetailList) {
        this.buyDetailList = buyDetailList;
    }

    @Override
    public String toString() {
        return "BuyOrderBean{" +
                "id=" + id +
                ", date=" + date +
                ", supplierName='" + supplierName + '\'' +
                ", buyUserName='" + buyUserName + '\'' +
                ", buyDetailList=" + buyDetailList +
                '}';
    }
}
